home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CICA Windows Explosion!
/
The CICA Windows Explosion! - Disc 2.iso
/
programr
/
cat_exe.zip
/
SQUARE.CAL
< prev
next >
Wrap
Text File
|
1994-11-18
|
1KB
|
54 lines
(* cp. Toffoli, p. 38 *)
(* Program creates squares. *)
RECIPE XYSize = 90;
XYBound = 1;
Colors = 2;
Zet = 2;
CONST Dead = 0;
Alive = 1;
VAR x;
REF east [1,0];
west [-1,0];
north [0,-1];
south [0,1];
n_east [1,-1];
n_west [-1,-1];
s_east [1,1];
s_west [-1,1];
EVENT SetUp;
RingForm;
PlClipAll;
RGBPalette(Colors, $0, $FF, $32,0, $B6,0);
ShowPlane;
EVENT E0;(* initialization of the cells *)
PlClipActive;
WinClipAll;
PARALLEL DO
x := Random (1000);
IF (x > 998)
THEN Self := Alive;
ELSE Self := Dead;
FI;
OD;
ShowPlane;
EVENT E1;
PARALLEL DO
Self := north OR south OR Self OR west OR east OR n_west OR n_east OR s_west OR s_east;
OD;
ShowPlane;
END.
********************************
* compilation o.k. *
********************************